<!-- this controls the landing page -->
<?php get_header(); ?>

<?php $i = 0; $j = 0;?>
<?php if ( is_home()  && $paged < 1 ) {
query_posts( 'posts_per_page=8' );
}
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); $i++; ?>
<div class="span-8 article post-<?php the_ID(); ?><?php if ($i == 3) { ?> last<?php  } ?>">
<?php get_the_image( array( 'custom_key' => array( 'thumbnail' ), 'default_size' => 'thumbnail', 'width' => '296', 'height' => '166' ) ); ?>
<h6 class="archive-header"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title() ?></a></h6>
<!-- moved images from here to above headline -->
<p class="postmetadata">by <?php coauthors_posts_links(); ?> | <?php the_time( get_option( 'date_format' ) ); ?>
</p>
<?php the_excerpt(); ?>
</div>
<!-- change 0 to 1 to put the widgets back in mix-->
<?php
	if ( is_home() && $paged < 1 ) {
		if ($i == 3 && $j < 1) { ?><div class="archive-stack clear"></div><?php $i = 0; $j++; } 
			elseif ($i == 2 && $j == 0) { ?><div class="column span-7 last adspace">
				<a href="https://www.facebook.com/breakinghistory" title="Facebook"><img class="sitead" src="/wp-content/themes/breaking-history/images/sitead.jpg" alt="Visit us on Facebook"></a>
				<div class="adbanner"><img src="/wp-content/themes/breaking-history/images/adbanner.png" alt="Email us about your ad here"><p>this is one of our ads. we'd rather show yours. <br />email us at <a href="mailto:contact@breaking-history.com?Subject=Ad space on Breaking History">contact@breaking-history.com</a></p></div>
			</div><div class="archive-stack clear"></div><?php $i = 0; $j++; } 
			elseif ($i == 3 && $j >= 1) { ?><div class="column span-7 last">
			</div><div class="archive-stack clear"></div><?php $i = 0; $j++; } 
	} else { 
	    if ($i == 3) { ?><div class="archive-stack clear"></div><?php $i = 0;}
	}
?>
<?php endwhile; endif; ?>

<div class="clear"></div>

<div class="navigation">
	<p id="older"><?php next_posts_link('&laquo; Older Entries') ?></p>
	<p id="newer"><?php previous_posts_link('Newer Entries &raquo;') ?></p>
</div>


<!-- CALL TO BOTTOM.PHP DELETED, WIDGETS ARE MIXED IN THE ABOVE CODE -->
<?php get_footer(); ?>